﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Freebase4net
{
    public static class FreebaseServicesBuilder
    {
        public static string ApiKey { get; private set; }

        static FreebaseServicesBuilder()
        {
            ApiKey = ConfigurationManager.AppSettings["FreebaseApiKey"];
        }

        /// <summary>
        /// Set up global api key
        /// </summary>
        /// <param name="apiKey"></param>
        public static void SetApiKey(string apiKey)
        {
            ApiKey = apiKey;
        }

        /// <summary>
        /// Create service for quering to Mql Read Service
        /// </summary>
        /// <returns></returns>
        public static MqlReadService CreateMqlReadService()
        {
            MqlReadService service = new MqlReadService(ApiKey);

            return service;
        }

        public static TextService CreateTextService()
        {
            TextService service = new TextService(ApiKey);
            return service;
        }

        public static ImageService CreateImageService()
        {
            ImageService service = new ImageService(ApiKey);
            return service;
        }

        public static TopicService CreateTopicService()
        {
            TopicService service = new TopicService(ApiKey);
            return service;
        }
    }
}
